import java.net.URL;
import java.net.URLClassLoader;

import com.myrice.remote.deploy.DeployClassLoader;
import com.myrice.remote.deploy.DeployContext;

public class DeployClassLoaderImpl implements DeployClassLoader {
	private URL[] urls;
	private ClassLoader classLoader;

	public DeployClassLoaderImpl(URL[] urls) {
		this.urls = urls;
	}

	@Override
	public void init(DeployContext context) {
		System.err.println("DeployClassLoaderImpl.init");
		this.classLoader = new URLClassLoader(urls);
	}

	@Override
	public void destroy() {
		System.err.println("DeployClassLoaderImpl.destroy");
		classLoader = null;
	}

	@Override
	public ClassLoader getClassLoader() {
		System.err.println("DeployClassLoaderImpl.getClassLoader");
		return classLoader;
	}

}
